package com.g13.virtualpethospital.dto;

import com.g13.virtualpethospital.config.AssistantConfig;
import com.g13.virtualpethospital.entity.base.ChatMessage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.IndexDirection;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;


import java.time.LocalTime;
import java.util.List;

/**
 * @Title: AssistantSessionData
 * @Author yyj1205
 * @Package com.g13.virtualpethospital.dto
 * @Date 10/4/2024 14:22
 * @description: ai助教的聊天缓存
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("ai助手缓存数据")
@Document("AssistantSessionData")
public class AssistantSessionData {
    @ApiModelProperty(value = "id")
    @Id
    String id;

    @ApiModelProperty(value = "计时器")
    @Indexed(direction = IndexDirection.DESCENDING, expireAfterSeconds = 3600)
    LocalTime time;

    @ApiModelProperty(value = "内容")
    List<ChatMessage> messageList;

}
